package com.xbongbong.pro.statistics.pojo;

import com.xbongbong.pro.statistic.result.pojo.WarningValuePojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * 统计图结果集
 * @author xinpeng.jiang
 * @date 2021/11/5 11:08
 * @version 1.0
 * @since V1.0
 */
@Getter
@Setter
@ToString
public class CkStatisticPojo implements Serializable{
    private static final long serialVersionUID = -420118971515686166L;

    /**
     * 汇总值formId
     */
    private Long formId;
    /**
     * 汇总值attr
     */
    private String attr;
    
    /**
     * 表头的唯一值
     */
    private String key;
    
    /**
     * 值
     */
    private String value;

    /**
     * 原值
     */
    private String originValue;
    
    /**
     * 总数
     */
    private Long docCount;
    
    /**
     * 下一层的chart
     */
    private List<Map<String, CkStatisticPojo>> sub;
    
    /**
     * 是否是分组字段
     */
    private Boolean head = false;

    /**
     * 是否是汇总字段
     */
    private Boolean isLeaf = false;

    /**
     * 为小计或总计字段
     */
    private Boolean isSummary = false;

    /**
     * 每个汇总字段的所有值
     */
    private List<String> values;

    /**
     * 预警值
     */
    private List<WarningValuePojo> warningValues;

    /**
     * 日期类型
     */
    private String dateGroupType;

    public CkStatisticPojo() {
    }

    public CkStatisticPojo(String attr, String key, String value) {
        this.attr = attr;
        this.key = key;
        this.value = value;
    }

    public CkStatisticPojo(String attr, String key, String value, String originValue) {
        this.attr = attr;
        this.key = key;
        this.value = value;
        this.originValue = originValue;
    }
}
